/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.bfpro.wot.stat;

import java.io.StringReader;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.json.*;
import javax.json.JsonValue.ValueType;

/**
 *
 * @author admin
 */
public class StatData {
    private int id;
    private int f_Timestamp;
    private String f_Data;
    private StatValues f_StatValues;

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the f_Timestamp
     */
    public int getTimestamp() {
        return f_Timestamp;
    }

    public String getDateTime() {
        DateFormat df = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");
        Date d1 = new Date((long)f_Timestamp*1000);
        return df.format(d1);
    }

    public String getDate() {
        DateFormat df = new SimpleDateFormat("dd.MM.yyyy");
        Date d1 = new Date((long)f_Timestamp*1000);
        return df.format(d1);
    }

    /**
     * @param f_Timestamp the f_Timestamp to set
     */
    public void setTimestamp(int f_Timestamp) {
        this.f_Timestamp = f_Timestamp;
    }

    /**
     * @return the f_Data
     */
    public String getData() {
        return f_Data;
    }

    /**
     * @param f_Data the f_Data to set
     */
    public void setData(String f_Data) {
        this.f_Data = f_Data;
    }

    /**
     * @return the f_StatValues
     */
    public StatValues get_StatValues() {
        return f_StatValues;
    }

    /**
     * @param f_StatValues the f_StatValues to set
     */
    public void parseStatValues() {
        StatValues statValues = new StatValues(this.f_Data);
        this.f_StatValues = statValues;
    }
}
